import Rx from "rxjs"

let foo = Rx.Observable.create(observer => {
    console.log("hello");
    observer.next(42);
    observer.next(32);
})

//箭头函数来进行简化(注意return)
// let afterMap = foo.map(function (value) {
//     return value * 2;
// })
let afterMap = foo.map(value => value * 2)


afterMap.subscribe(x => {
    console.log(x);
})
